DevJourney

Python/RegEx/String with combination of a and bs/String has a followed by 2-3 bs/String has a followed by 2-3 bs.py

import re

str = input("Enter a string: ")
rePat = r'ab{2,3}'
if re.findall(rePat,str):
    print("String has an a followed by 2 or 3 bs")
else:
    print("String does not have an a followed by 2 or 3 bs")
View on GitHub